
const mongoose = require("../utils/DB");

const cinemasModel = require('../models/cinemasModel')
//创建数据模型
let theatersSchema = new mongoose.Schema({
    // id : String, // mongodb 自动生成的 id
    name : String, // 放映厅名字
    status : Boolean, // 放映厅是否营业（可选）
    cinemasId : {
      type: mongoose.Schema.Types.ObjectId,
      ref: "cinemasModel"
    }, // 放映厅从属的影院 id
});
//映射数据模型
let theatersModel = mongoose.model('theatersModel', theatersSchema, 'theaters');

module.exports = theatersModel